﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="Menu.aspx.cs" Inherits="Menu" Title="Menu List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Menu List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
	<asp:UpdatePanel ID="UpdatePanel1" runat="server">
	<ContentTemplate>
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="MenuDataSource"
				DataKeyNames="Id"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_Menu.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="[Title]"  />
				<asp:BoundField DataField="Alias" HeaderText="Alias" SortExpression="[Alias]"  />
				<asp:BoundField DataField="Link" HeaderText="Link" SortExpression="[Link]"  />
				<asp:BoundField DataField="ParentId" HeaderText="Parent Id" SortExpression="[ParentId]"  />
				<asp:BoundField DataField="OrderIndex" HeaderText="Order Index" SortExpression="[OrderIndex]"  />
				<data:BoundRadioButtonField DataField="IsVisible" HeaderText="Is Visible" SortExpression="[IsVisible]"  />
				<asp:BoundField DataField="MenuType" HeaderText="Menu Type" SortExpression="[MenuType]"  />
				<asp:BoundField DataField="MenuPosition" HeaderText="Menu Position" SortExpression="[MenuPosition]"  />
				<asp:BoundField DataField="Language" HeaderText="Language" SortExpression="[Language]"  />
				<asp:BoundField DataField="CreatedDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Created Date" SortExpression="[CreatedDate]"  />
				<asp:BoundField DataField="UpdatedDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Updated Date" SortExpression="[UpdatedDate]"  />
				<asp:BoundField DataField="CreatedUser" HeaderText="Created User" SortExpression="[CreatedUser]"  />
				<asp:BoundField DataField="UpdatedUser" HeaderText="Updated User" SortExpression="[UpdatedUser]"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No Menu Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnMenu" OnClientClick="javascript:location.href='MenuEdit.aspx'; return false;" Text="Add New"></asp:Button>
	</ContentTemplate>
	</asp:UpdatePanel>	
		<data:MenuDataSource ID="MenuDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
		>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:MenuDataSource>
	    		
</asp:Content>



